import request from '@/utils/request';

// 仓库列表
export function queryWarehouse(data) {
    return request({
        url: '/system/warehouse/queryWarehouse',
        method: 'get',
        params: data
    })
}

// 新建仓库
export function warehouseAdd(data) {
    return request({
        url: '/system/warehouse/insert',
        method: 'post',
        data: data
    })
}

// 编辑仓库库管员
export function warehouseUpdate(data) {
    return request({
        url: '/system/warehouse/update',
        method: 'post',
        data: data
    })
}

// 修改是否启用仓位仓位
export function warehouseUpdateStatus(data) {
    return request({
        url: '/system/warehouse/updateStatus',
        method: 'post',
        data: data
    })
}

// 查询仓库列表
export function warehouseList(data) {
    return request({
        url: '/system/warehouse/list',
        method: 'get',
        params: data
    })
}

// 根据仓库id查询下级
export function searchWarehouseList(id) {
    return request({
        url: '/system/warehouse/listByWarehouseId?warehouseId=' + id,
        method: 'get'
    })
}

// 根据当前仓库id查询所有上级名称
export function searchWarehouseName(id) {
    return request({
        url: '/system/warehouse/queryWarehouseName?warehouseId=' + id,
        method: 'get'
    })
}

// 根据仓库id查询库存
export function searchWarehouseId(id) {
    return request({
        url: '/system/productStorage/queryByWarehouseId?warehouseId=' + id,
        method: 'get'
    })
}